﻿@using System.Collections.Generic
@using Microsoft.AspNetCore.Http
@using Microsoft.AspNetCore.Http.Authentication
@using Models.AccountViewModels;
@using Models.Application;
@using Microsoft.AspNetCore.Identity;

@model LoginViewModel

@inject SignInManager<ApplicationUser> SignInManager

@{
  ViewData["Title"] = "Please Log in";
}

<h3>@ViewData["Title"]</h3>
<div class="row">
  <div class="col-md-12">
    <section>
      <form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
        <hr />
        <div asp-validation-summary="All" class="text-danger"></div>
        <div class="form-group">
          <label asp-for="Email" class="col-md-2 control-label"></label>
          <div class="col-md-10">
            <input asp-for="Email" class="form-control" />
            <span asp-validation-for="Email" class="text-danger"></span>
          </div>
        </div>
        <div class="form-group">
          <label asp-for="Password" class="col-md-2 control-label"></label>
          <div class="col-md-10">
            <input asp-for="Password" class="form-control" />
            <span asp-validation-for="Password" class="text-danger"></span>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-10">
            <div class="checkbox">
              <label asp-for="RememberMe">
                <input asp-for="RememberMe" />
                @Html.DisplayNameFor(m => m.RememberMe)
              </label>
            </div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-10">
            <button type="submit" class="btn btn-default">Log in</button>
          </div>
        </div>
        <p>
          <a asp-action="ForgotPassword">Forgot your password?</a>
        </p>
      </form>
    </section>
  </div>
</div>

@section Scripts {
  @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}
